﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Windows;
using CommonInterfaces.Models;
using System.Windows.Input;

namespace StandardScriptItems.SimpleControls
{
    public class ScriptItemList : UserControl
    {
        Grid Griddy;
        int nextColumn = 0;

        public ScriptItemList()
        {
            Name = "ArgumentList";
            
            Griddy = new Grid();
            Griddy.Name = "Griddy";
            
            Content = Griddy;
        }


        public void Add(UIElement elem)
        {
            Griddy.ColumnDefinitions.Add(new ColumnDefinition());
            Grid.SetColumn(elem, nextColumn);
            nextColumn++;
            Griddy.Children.Add(elem);
        }

        public override string ToString()
        {
            StringBuilder buff = new StringBuilder();
            foreach (UIElement elem in Griddy.Children)
                buff.Append(elem.ToString()).Append(" | ");
            String ret = buff.ToString();
            ret = ret.Substring(0, ret.Length - 3);
            return ret;
        }
    }
}
